package j04super;
/*
父类的属性初始化
 */
public class J1super {
}
/*
当new一个子类实例的时候，会自动new一个父类实例
    默认调用父类的无参构造
 */
class Fa{
    int a;
    int b;

    public Fa(int a, int b) {
        this.a = a;
        this.b = b;
    }
}
class Ch extends Fa{
    int c;
    int d;

    public Ch(int a, int b,int c, int d) {
        //隐藏代码,super（）调用父类的构造
        super(a,b);
        this.c = c;
        this.d = d;
    }

    public void sayInfo(){
        System.out.println("a = " + a);
        System.out.println("b = " + b);
        System.out.println("c = " + c);
        System.out.println("d = " + d);
    }
}
class ChTest{
    public static void main(String[] args) {
        Ch ch1 = new Ch(1,2,3,4);
        ch1.sayInfo();
    }
}